module.exports = app => {
    const { router, controller } = app;

    router.get('/api/pub/admin/initAuthInfo', controller.admin.initAuthInfo);

    router.post('/api/pub/admin/register', controller.admin.adminRegister);
    router.post('/api/pub/admin/login', controller.admin.adminLogin);
    router.post('/api/pub/admin/logout', controller.admin.adminLogout);
    router.post('/api/pub/admin/doRedis', controller.admin.doRedis);

    router.post('/api/admin/addAdmin', controller.admin.addAdmin);
    router.put('/api/admin/editAdmin', controller.admin.editAdmin);
    router.get('/api/admin/getAdmin/:userId', controller.admin.getAdmin);
    router.get('/api/admin/getAdminList', controller.admin.getAdminList);
    router.del('/api/admin/delAdmin/:userId', controller.admin.delAdmin);

    router.post('/api/admin/addRole', controller.admin.addRole);
    router.put('/api/admin/editRole/:roleId', controller.admin.editRole);
    router.get('/api/admin/getRole', controller.admin.getRole);
    router.del('/api/admin/delRole/:roleId', controller.admin.delRole);

    router.post('/api/admin/addApiAuth', controller.admin.addApiAuth);
    router.put('/api/admin/editApiAuth/:apiId', controller.admin.editApiAuth);
    router.get('/api/admin/getApiAuth', controller.admin.getApiAuth);
    router.del('/api/admin/delApiAuth/:apiId', controller.admin.delApiAuth);

    router.put('/api/admin/bindUserRole/:userId', controller.admin.bindUserRole);

    router.post('/api/admin/bindRoleApi', controller.admin.bindRoleApi);
    router.del('/api/admin/unbindRoleAuthById/:raId', controller.admin.unbindRoleAuthById);
    router.del('/api/admin/unbindRoleAuth', controller.admin.unbindRoleAuth);

    router.get('/api/admin/getBindRoleApi', controller.admin.getBindRoleApi);
    router.get('/api/admin/getUnbindRoleApi', controller.admin.getUnbindRoleApi);
};